<%--
  Created by IntelliJ IDEA.
  User: marvelous
  Date: 2020/7/21
  Time: 1:31 上午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

<html>
<head>
    <title>Resume</title>

    <script type="text/javascript" src="/js/jquery.min.js"></script>

    <script>

        function deleteResume(id) {
            let message = confirm("确认是否删除改记录");
            if (message == true) {
                $.ajax({
                    url: '/resume/' + id,
                    type: 'DELETE',
                    success: function () {
                        window.location.href = "/resume/list"
                    }
                })
            }
        }
    </script>
</head>
<body>
<table>
    <tr>
        <th>id</th>
        <th>address</th>
        <th>name</th>
        <th>phone</th>
        <th><a id="create" href="/resume">新增</a></th>
    </tr>
    <c:forEach items="${resumes}" var="resume">
        <tr>
            <td>${resume.id}</td>
            <td>${resume.address}</td>
            <td>${resume.name}</td>
            <td>${resume.phone}</td>
            <td><a id="edit" href="/resume/${resume.id}">编辑</a> <a id="delete" href="javascript:void(0)"
                                                                   onclick="deleteResume(${resume.id})">删除</a></td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
